Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Foldable1 primitives #512

Merged
merged 7 commits into from
Sep 8, 2013

Conversation

S11001001
Copy link
Member

The primitives, introduced in f29c54d, should be easier to use in more cases. The essential difference is the new initializer.

It also requires testing less stuff. dcc224e explains the advantages. For reference, the problem was obliquely referred to originally in b8ca77e.

How does this sound to you, @puffnfresh?

…tency checks.

It is now a free theorem that the call structure of a Foldable1's left
fold looks like f(f(f(z(a), a), a), a) for some arbitrary depth,
i.e. is called left-associative.  Likewise, the left fold must be
called as f(a, f(a, f(a, z(a)))) for some arbitrary depth.

We formerly tested this property, but with foldMapLeft1 and
foldMapRight1 as primitives with the above free theorems, this is no
longer necessary.  So we just reformulate the (still valuable)
consistency checks from Foldable.
@puffnfresh
Copy link
Member

Awesome 👍

larsrh added a commit that referenced this pull request Sep 8, 2013
@larsrh larsrh merged commit 023f634 into scalaz:scalaz-seven Sep 8, 2013
@larsrh
Copy link
Contributor

larsrh commented Sep 8, 2013

This is a source-breaking change. I suspect it's easy to deal with though, so I'm just going to point to 17c9f21 in the release notes.

@S11001001
Copy link
Member Author

@larsrh Yes on all counts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants